package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.WorkerMapper;
import com.ruoyi.manage.domain.Worker;
import com.ruoyi.manage.service.IWorkerService;

/**
 * 社工Service业务层处理
 * 
 * @author Admin
 * @date 2025-09-06
 */
@Service
public class WorkerServiceImpl implements IWorkerService 
{
    @Autowired
    private WorkerMapper workerMapper;

    /**
     * 查询社工
     * 
     * @param id 社工主键
     * @return 社工
     */
    @Override
    public Worker selectWorkerById(Long id)
    {
        return workerMapper.selectWorkerById(id);
    }

    /**
     * 查询社工列表
     * 
     * @param worker 社工
     * @return 社工
     */
    @Override
    public List<Worker> selectWorkerList(Worker worker)
    {
        return workerMapper.selectWorkerList(worker);
    }

    /**
     * 新增社工
     * 
     * @param worker 社工
     * @return 结果
     */
    @Override
    public int insertWorker(Worker worker)
    {
        worker.setCreateTime(DateUtils.getNowDate());
        return workerMapper.insertWorker(worker);
    }

    /**
     * 修改社工
     * 
     * @param worker 社工
     * @return 结果
     */
    @Override
    public int updateWorker(Worker worker)
    {
        worker.setUpdateTime(DateUtils.getNowDate());
        return workerMapper.updateWorker(worker);
    }

    /**
     * 批量删除社工
     * 
     * @param ids 需要删除的社工主键
     * @return 结果
     */
    @Override
    public int deleteWorkerByIds(Long[] ids)
    {
        return workerMapper.deleteWorkerByIds(ids);
    }

    /**
     * 删除社工信息
     * 
     * @param id 社工主键
     * @return 结果
     */
    @Override
    public int deleteWorkerById(Long id)
    {
        return workerMapper.deleteWorkerById(id);
    }
}
